home *** CD-ROM | disk | FTP | other *** search
- #include <MacTypes.h>
- #include <ListMgr.h>
-
- #ifndef NULL
- #define NULL 0L
- #endif
- #define MAX_ROWS 8
- #define MAX_COLUMNS 8
-
- #define CELL_WIDTH 96
- #define CELL_HEIGTH 16
-
- #define ENTER_DATA_DIALOG 128
- #define APPLE_MENU 1
- #define FILE_MENU 256
- #define EDIT_MENU 257
-
-
- /* Types for cell */
- #define CLEARED -1
- #define UNDEFINED 0
- #define STRING 1
- #define FORMULA 2
- #define CONSTANT 3
-
- struct cell_struct{
- int type ;
- double value ;
- Str255 formula ;
- } ;
-
- typedef struct cell_struct CELL, *CELL_PTR, **CELL_HDL ;
-
- struct sheet_win{
- WindowPtr sheet_window_ptr ;
- ListHandle sheet_list_hdl ;
- CELL sheet_data[MAX_ROWS][MAX_COLUMNS] ;
- } ;
-
- typedef struct sheet_win SHEET_WIN, *SHEET_WIN_PTR, **SHEET_WIN_HDL ;
-
- /* Argument types */
- #define VALUE_ARG 1
- #define STRING_ARG 2
-
- /* Arg usage defines */
- #define IN_USE TRUE
- #define FREE_ARG FALSE
-
- struct fun_arg{
- struct fun_arg *next_arg ;
- int in_use ;
- int type ;
- double value ;
- Str255 string ;
- } ;
-
- typedef struct fun_arg ARG, *ARG_PTR, **ARG_HDL ;
-
- struct fun_entry{
- char fun_name[32] ;
- double (*fun_ptr)( ) ;
- } ;
-
- typedef struct fun_entry FUN_ENTRY, *FUN_ENTRY_PTR, **FUN_ENTRY_HDL ;
-
- /* Prototypes */
- int DoInit( void ) ;
- void DoEventLoop( void ) ;
- void DoActivate( EventRecord * ) ;
- void DoUpdate( EventRecord * ) ;
- void DoMouseDown( EventRecord * ) ;
-
- int ClikLoop( void ) ;
- void EnterData( Cell, SHEET_WIN_HDL ) ;
- void DoCalc( SHEET_WIN_HDL ) ;
-